
package com.zsrt.day20170427.ch04;

public class PhoneFactory {

	public  static Phone generatePhone(String name,int price){
		if(name.equals("xiaomishouji")){
			
			return new XiaomiPhone(price);
		}else if(name.equals("huaweishouji")){
			return new HuaweiPhone(price);
		}
		return null;
	 }

	private PhoneFactory() {}
}
